package main

import (
	"testing"

	"gitverse.ru/nickolasfox/kek/pkg/tools"
)

var (
	exitMock = &tools.ExitMock{}
)

func Test_main(t *testing.T) {
	t.Run("ok", func(sub *testing.T) {
		tools.WithExit(sub, exitMock)
		tools.WithArgs(sub, []string{"kek"})
		main()

		expected := tools.ExitOk
		if result := exitMock.LastCode(); result != expected {
			sub.Errorf("expected: %d, got: %d", expected, result)
		}
	})
}
